<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <new-data :str='str' :num='num'></new-data>
    </div>

    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        Vue.component('new-data',{
            data:function(){
                return {
                    son:'10',
                }
            },
            props:['str','num'],
            template:`
                <div>
                    <h2>我是子组件的值：{{son}}</h2>
                    <h2>我是父组件的值：{{num}} {{str}}</h2>
                </div>
            `

        });
        new Vue({
            el:'#app',
            data:function(){
                return {
                    str:`我是父组件传的值`,
                    num:10
                }
            }
        })
        
    </script>
</body>
</html>